home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 9
/
The PC-SIG Library on CD ROM - Ninth Edition.iso
/
1701_800
/
DISK1755
/
DISK1755.ZIP
/
READ.ME
< prev
next >
Wrap
Text File
|
1988-10-12
|
15KB
|
445 lines
FUGUE UTILITIES #2
==================
The files included on this disk are mostly helpful utilities for use in
batch files. The programs included are:
BATCH UTILITIES
===============
ACCEPT.COM
ASK.COM
BEEP.COM
EDITENV.EXE
EXCLUDE.COM
RENAMED.COM
SYSDATE.COM
XQT.EXE
YESNO.EXE
OTHER UTILITIES
===============
DOSH.COM
ED.EXE
REGISTRATION
============
If you find these programs useful,
you are encouraged to send $25 to
David Noakes
P.O. BOX 942,
WODEN ACT 2606,
AUSTRALIA
This helps me to continue to develop other programs. Feel free to give
the programs away to friends, provided you also give them a copy of this
READ.ME file. If you have any suggestions as to how these or other
programs could be improved, write to me. If you are a registered user,
then I will be happy to hear from you.
DESCRIPTION
===========
ACCEPT This program accepts information from the keyboard,
terminated by a Carriage Return. It does not prompt, it is
assumed that the batch file prompts by means of echo
statements. It takes a string as a parameter, and appends
the accepted information to the end of the string. This
string is then displayed through the standard output
device, allowing redirection to be used.
eg:
ECHO A - Accounts
ECHO B - Basic
ECHO C - Turbo C
ECHO
ECHO Enter the letter of your choice, followed by CR
ACCEPT zz>zcmd.bat
ZCMD
or
ECHO Enter date to back up files from (MMDDYY)
ACCEPT BKUP > ZCMD.BAT
ZCMD
ASK This program is used for a similar purpose to ACCEPT, but
it displays the string parameter as a prompt. It accepts
only one character in reply, without the need to enter CR.
Thus it is more suited to building a menu system from
batchg files and prompts. It sets the batch file variable
ERRORLEVEL to the numeric value represented by the ASCII
code of the letter entered.
eg:
ECHO A - Accounts
ECHO B - Basic
ECHO C - Turbo C
ECHO
ASK Enter the letter of your choice (A,B,C)
IF ERRORLEVEL 51 ACCOUNTS
IF ERRORLEVEL 50 BASIC
IF ERRORLEVEL 49 TC
BEEP This program emits a half second beep through your
computer's speaker. Useful for alerting you when a long job
has finished
eg:
ARC U C-SOURCE *.C *.H *.OBJ *.EXE
BEEP
EDITENV There are times when you wish to set an environment
variable from a batch file. The SET statement is not always
useful for this purpose. Programs can interrogate the
environment, but can only set values in their own copy of
the environment. This program sets values in the master
copy of the environment that all other copies are made
from.
If you are running batch files from a memory resident
shell, you will probably find that you should exit the
shell, since its environment may not be altered, but its
parent will.
Editenv will not only set variables to values, it will also
replace substrings with new substrings, or delete
substrings.
The syntax is
EDITENV <varname> [<search-pattern>] <pattern>
/S for substitute
/D for delete
special search patterns ^ is start of string
$ is end of string
eg:
set the variable PATH
EDITENV PATH c:\dos;c:\lotus;c:\turbo-c;c:\;c:\wordstar;
will result in path taking the value
c:\dos;c:\lotus;c:\turbo-c;c:\;c:\wordstar;
eg:
to substitute a value
assume path has the value
c:\dos;c:\lotus;c:\turbo-c;c:\;c:\wordstar;
to add a new value eg c:\pascal
EDITENV PATH $ C:\PASCAL; /S
will result in path taking the value
c:\dos;c:\lotus;c:\turbo-c;c:\;c:\wordstar;C:\PASCAL;
EDITENV PATH ^ C:\PASCAL; /S
will result in path taking the value
C:\PASCAL;c:\dos;c:\lotus;c:\turbo-c;c:\;c:\wordstar;
EDITENV PATH c:\; C:\PASCAL; /S
will result in path taking the value
c:\dos;c:\lotus;c:\turbo-c;C:\PASCAL;c:\wordstar;
eg:
to delete an existing value
EDITENV PATH c:\wordstar /D
will result in path taking the value
c:\dos;c:\lotus;c:\turbo-c;C:\PASCAL;
EXCLUDE This program is used to exclude a list of files from any
command. It does this by setting the hidden bit on the list
of files, running the command, and then resetting the
hidden bit.
syntax: EXCLUDE <filelist> <command>
eg EXCLUDE *.tpu dir *.*
will result in a directory of all files except those with
the extension TPU
eg EXCLUDE HEL??.* ARC U P-SOURCES *.PAS *.ASM
will hide say HELP1.PAS, and archive all other files with
the extension PAS
RENAMED This program is used to change the name of a directory.
This saves having to move files out of a directory,
deleting it and setting up again under the new name.
syntax:
RENAME [d:]<oldname> <newname>
eg:
RENAMED C:\PASDIR PASCAL
SYSDATE This program is useful for those people who dont have a
battery backed clock. The program should be included in
your autoexec file, and will remember the last date that
you booted. It will allow you to use the arrow keys to
change the date displayed.
XQT Normally you cannot nest runs of batch files within other
batch files - call the new batch file, and the old one
terminates. XQT handles all of this - it takes the batch
file name as a parameter, followed by any parameters to the
batch file. It runs the batch file, and passes the
parameters to it. It does require COMMAND.COM to achieve
this.
syntax XQT [d:]<batchfile> [<parameters>...]
eg
XQT b:zcmd parameter another third
will run the batch file b:zcmd.bat, and pass the parameters
paremeter another third
to it.
YESNO This program is similar to ASK, except that it accepts only
the letters Y,y,N or n. It displays a prompt, and waits
till the user enters either Y or N. It sets the batch file
variable ERRORLEVEL to 1 for Y or y, and sets it to 0 for N
or n.
syntax YESNO <prompt>
eg:
YESNO Do you wish to backup the files
if ERRORLEVEL 1 XQT BU ACCOUNTS
where BU.BAT is a file that takes a parameter to tell it
which files to backup.
OTHER UTILITIES
===============
DOSH
====
This comes under the category of yet another memory resident DOS
handler (hence the name DOSH). Dosh keeps a circular queue of
commands, and makes them available via the arrow commands. Up arrow
for previous command(s), Down arrow for the commands from the other
end of the queue. You can edit these commands using common editing
commands:
Home - start of command
End - end of command
INS - toggle insert mode
Left Arrow - move cursor left
Right Arrow - move cursor right
Ctrl Home - delete from cursor to start of string
Ctrl End - delete from cursor to end of string
DEL - delete the character under the cursor, and shift
characters left
<= - Backspace delete the character to the left of the
cursor, and shift characters left
Ctrl Left Arrow - move cursor to the next word to the left
Ctrl right Arrow - move cursor to the next word to the right
With this implementation, the 10 or 12 function keys on most
machines have their own functions.
F1 change foreground color forward
F2 change background color forward
F3 utilise the editor ED (share ware available from me)
F4 Browse
F5 utilise the dos shell SR - share ware
F6 copy
F7 exclude - shareware available from me
F8 arc - another shareware program
F9 dir
F10 CLS - this will handle EGA 43 line mode, and will set screen
color to the default stored in DOSH
F11 Backup - only if your DOS handles these keys
F12 Restore " " " " " " "
Shift F1 - change foreground color backwards
Shift F2 - change background color backwards
Function keys F3 to F12 are stored as pascal type strings (max length
32 characters, first character is string length). These can be hacked
by any enterprising person to reflect new values - use Norton
Utilities or Debug, and Work from a COPY! If the string ends in a
carriage return, it will be sent to Dos, otherwise it will appear on
the screen for editing.
The Dosh functions are available to all programs that use the Dos get
input function (interupt 21h function 0Ah) to obtain input. It is
memory resident, but does not interfere with programs such as Sidekick
and Smartkey etc.
ED
==
This is a simple editor with WordStar like commands. It edits files in
ascii. The largest file is limited to 64K, and one window.
If you prefer a more complex editor with multi windows, word processing
functions and so on send me $30 for a copy of FRED (Friendly Editor) V3.01
Function Keys
=============
F1 - Help
F2 - Save - ^K^S
F3 - Done - ^K^D
WORDSTAR PC
CURSOR MOVEMENTS: COMMAND KEY
Character left Ctrl-S <-
Character right Ctrl-D ->
Word left Ctrl-A Ctrl <-
Word right Ctrl-F Ctrl ->
Line up Ctrl-E Up arrow
Line down Ctrl-X Down Arrow
Scroll up Ctrl-W
Scroll down Ctrl-Z
Page up Ctrl-R PgUp
Page down Ctrl-C PgDn
To left on line Ctrl-Q-S Home
To right on line Ctrl-Q-D End
To top of file Ctrl-Q-R Ctrl Pg Up
To end of file Ctrl-Q-C Ctrl Pg Dn
To beginning of block Ctrl-Q-B
To end of block Ctrl-Q-K
INSERT & DELETE COMMAND KEY
Insert mode on/off Ctrl-V Ins
Insert line Ctrl-N
Delete line Ctrl-Y
Delete to end of line Ctrl-Q-Y
Delete right word Ctrl-T
Delete char under cursor Ctrl-G Del
Delete left character Ctrl-H <=
BLOCK COMMANDS COMMAND KEY
Mark block begin Ctrl-K-B
Mark block end Ctrl-K-K
Hide/display block Ctrl-K-H
Copy block Ctrl-K-C
Move block Ctrl-K-V
Delete block Ctrl-K-Y
Read block from disk Ctrl-K-R
Write block to disk Ctrl-K-W
Save File Ctrl-K-S
MISC. COMMANDS COMMAND KEY
Save & Exit Ctrl-K-D F3
Tab Ctrl-I |->
Repeat last find Ctrl-L
Control character prefix Ctrl-P
Find Ctrl-Q-F
Find & replace Ctrl-Q-A
Set marker 0 .. 3 Ctrl-K 0 .. 3
Go To marker 0 .. 3 Ctrl Q 0 .. 3
Toggle Auto indent mode Ctrl Q I
Toggle fixed tabs Ctrl O T
Restore Line Ctrl Q L
Print Block Ctrk K P
Search and Replace Options
B Search and replace backwards, i.e. search and
replace from the current cursor position
towards the beginning of the text.
G Global search and replace, i.e. search and
replace in the entire text, irrespective of the
current cursor position.
n n = any number. Find and replace n occurrences
of the search string, counted from the current
cursor position.
N Replace without asking, i.e. do not stop and
ask Replace (Y/N) for each occurrence of the
search string.
U Ignore upper/lower case, i.e. regard upper and
lower case alphabeticals as equal.
W Search and replace whole words only, i.e. skip
matching patterns which are embedded in other
words.
L Search and replace local to marked block only
Examples
N10 Find the next ten occurrences of the search
string and replace without asking.
GWU Find and replace whole words in the entire
text. Ignore upper/lower case.
W Search for whole words only, i.e. the search
string 'term' will only match the word
'term', not the word 'terminal'.
BU Search backwards and ignore upper/lower case,
i.e. 'Block' will match both 'blockhead' and
'BLOCKADE', etc.
Terminate the list of options with <_| (CR), and the
search and replace starts. If the search string is
found, the cursor is positioned at the end of it,
and you must response to the question: Replace
(Y/N)?. You may abort the search and replace ope-
ration at this point with the Abort command (Ctrl-
U). The search and replace operation may be re-
peated by the Repeat last find command (Ctrl-L).
A global search and replace with the N-option
specified (Replace without asking) normally shows
each replacement on the screen. This is suspended
if you press any key, resulting in a faster opera-
tion.
Enjoy!
David Noakes
P.O. BOX 942,
WODEN ACT 2606,
AUSTRALIA